﻿using System;

namespace Borg
{
    [Serializable]
    public class ExtensionEventArgs : EventArgs
    {
        private readonly Extension _extension;

        public Extension Extension
        {
            get { return _extension; }
        }

        public ExtensionEventArgs(Extension extension)
        {
            if (extension == null)
                throw new ArgumentNullException("extension");
            
            _extension = extension;
        }

        public override bool Equals(object obj)
        {
            if (this == obj)
                return true;

            if (!(obj is ExtensionEventArgs))
                return false;
            
            return Equals(_extension, ((ExtensionEventArgs)obj)._extension);
        }

        public override int GetHashCode()
        {
            return _extension.GetHashCode();
        }
    }


}
